package com.wwg.design.patten.observer.case2;

import java.util.Observable;

/**
 * 被观察者小米
 * @author : wwg
 * @since : 2021/7/24
 *
 * @see Observable 被观察者实现类
 */
public class XiaoMi extends Observable {

    private String product;
    private String event;

    public String getProduct() {
        return product;
    }

    public void setProduct(String product) {
        this.product = product;
    }

    public String getEvent() {
        return event;
    }

    public void setEvent(String event) {
        this.event = event;
    }

    public void happen(String product,String event){
        setChanged();
        String x = product + event;
        System.out.println(x);
        this.notifyObservers(x);
    }
}
